<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-10-17 16:37:43
 * @LastEditTime: 2019-10-23 09:48:09
 * @LastEditors: Please set LastEditors
 -->
<template>
<div class="container">
<van-nav-bar title="vant Scroll组件" left-arrow fixed :border="false"
      @click-left='$router.push("/")'/>
<van-list
  v-model="loading"
  :finished="finished"
  finished-text="没有更多了"
  @load="onLoad"
>
  <van-cell
    v-for="item in list"
    :key="item"
    :title="item"
  />
</van-list>
</div>
</template>
<script>
export default {
    data(){
        return{
            list:[],
            loading:false,
            finished:false,
            cur_page:1,
            mock:[1,2,3,4,5]
        }
    },
    mounted(){
      this.onLoad();
    },
    methods: {
        onLoad(){
            this.loading = true;
            setTimeout(()=>{
              if(this.list.length> 20){
                this.loading = false;
                this.finished = true;
                return;
              }
              this.list = this.list.concat(this.mock);
              this.loading = false;
              
            },1000)
        }
    },
}
</script>
<style lang="less" scoped>

</style>